package Work1;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;

/*
 *@Student 张策
 */
public class Main {
    public static void main(String[] args) {
        ArrayList list=new ArrayList();
        list.add(new News("新闻一:5678901234567890"));
        list.add(new News("新闻二:567890"));
        for (int i = list.size()-1; i >=0 ; i--) {
           News news= (News)list.get(i);
            System.out.println(fun1(news.getTitle()));
        }
    }
    public static String fun1(String string){
        if(string.length()>15){
            return string.substring(0,15)+"...";
        }else return string;
    }
}